<%@ page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"	language="java"%>
<%@page import="com.us.usws.common.resourcetree.ResourceTreeLoader"%>
<%@page import="com.us.usws.support.ext.CacheManager"%>

<html>
<%

	String[] chkOptions = request.getParameterValues("chkOption");
	boolean checked = false;
	boolean showConf = false;

	String failure = null;

	if (chkOptions != null && chkOptions.length > 0) {
		checked = true;
		for (String eachOpt : chkOptions) {
			if ("resourceTree".equals(eachOpt)) {
				ResourceTreeLoader.getInstance().refresh();
			}else if("userCache".equals(eachOpt)){
				CacheManager.getUserCache().refresh();
			}else if("dictCache".equals(eachOpt)){
				CacheManager.getDictCache().refresh();
			}else if("videoTypeExtattrCache".equals(eachOpt)){
				CacheManager.getVideoTypeExtattrCache().refresh();
			}else if("channelCache".equals(eachOpt)){
				CacheManager.getChannelCache().refresh();
			}else if("videoCatCache".equals(eachOpt)){
				CacheManager.getVideoCatCache().refresh();
			}
		}
	}

%>
<head>
<title>Cache Manager</title>

</head>
<body>
<table style="padding: 10px">
<tr valign="top">

<td>
<form action="" method="post">
<fieldset>
<legend>缓存管理</legend>
<table cellpadding="0" cellspacing="0" border="0">
	<tr>
		<td><input type="checkbox" name="chkOption" value="resourceTree" checked="checked">树形菜单
		</td>
	</tr>
	<tr>
		<td><input type="checkbox" name="chkOption" value="userCache" checked="checked">用户缓存</td>
	</tr>
	<tr>
		<td><input type="checkbox" name="chkOption" value="dictCache" checked="checked">字典缓存</td>
	</tr>
	<tr>
		<td><input type="checkbox" name="chkOption" value="channelCache" checked="checked">频道缓存</td>
	</tr>
	<tr>
		<td><input type="checkbox" name="chkOption" value="videoCatCache" checked="checked">视频类别缓存</td>
	</tr>
	<tr>
		<td><input type="checkbox" name="chkOption" value="videoTypeExtattrCache" checked="checked">视频类型扩展属性缓存</td>
	</tr>
	<tr>
		<td><input type="submit" name="submit" value="清空缓存"></td>
	</tr>
</table>
</fieldset>
</form>
</td>

</tr>
</table>

<%if (checked) {%>
清空缓存成功<%
}%>

</body>
</html>